package com.zhiyou.app.shop.manager.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.zhiyou.app.shop.manager.dao.IUserDao;
import com.zhiyou.app.shop.manager.dao.pojo.UserDetail;
import com.zhiyou.app.shop.manager.service.IBaseService;

@Service
public class BaseServiceImpl implements IBaseService{
	@Autowired
	private IUserDao userDao;
	
	public List<UserDetail> test(int i) {
		UserDetail ud = new UserDetail();
		ud.setLoginName("zhangkewei");
		ud.setFullName("张科伟");
		ud.setPassword("12345");
		userDao.save(ud);
		ud.setFullName("张三");
		if(i==1) throw new RuntimeException("there is an error");
		userDao.update(ud);
		return userDao.findByProperty( "loginName", "zhangkewei");
	}
}
